package org.java.auth;

import org.java.user.api.PasswordEncoderConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.security.crypto.password.PasswordEncoder;

@SpringBootApplication
@EnableFeignClients(basePackages = {"org.java.user.api"})
@Import(PasswordEncoderConfig.class)
public class AuthorizationCenter {
    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(AuthorizationCenter.class, args);
        PasswordEncoder pe = ctx.getBean(PasswordEncoder.class);
        String password = pe.encode("1234");
        System.out.println("1234加密后的密文: " + password);
    }
}
